package com.example.demo.controller;


import com.example.demo.dto.TaskDto;
import com.example.demo.entity.DataConnection;
import com.example.demo.service.TestService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class TestController {

    private final TestService testService;

    @PostMapping("/add")
    public void addTask(@RequestBody TaskDto taskDto){
        testService.addTask(taskDto);
    }

    @GetMapping("/select")
    public List<DataConnection> select(@RequestParam("datasourceKey") String datasourceKey){
        return testService.select(datasourceKey);
    }

    @PostMapping("/addDatasource")
    public void addDatasource(){
        testService.addDatasource();
    }

}
